import axios from 'axios'
/* eslint-disable */
export default class PortalApiActions{
    public vm:any;
    constructor(vm:any){
       this.vm=vm;
    }

    /**
     * 根据条件查询Spu信息
     * @param params
     */
    static async getSpuListByName(params:any){
        const result=await axios.post(`mshop/api/gataway/spus/getSpuListByName`,params);
        return result;
    }

    /**
     * 根据参数获取Spu信息
     * @param params
     */
    static async getSpuByCondition(params:any){
        const result=await axios.post(`mshop/api/gataway/spus/getSpuByCondition`,params);
        return result;
    }

    /**
     * 注册
     * @param params
     */
    static async register(params:any){
        const result=await axios.post(`mshop/api/gataway/users/register`,params);
        return result;
    }

    /**
     * 登录
     * @param params
     */
    static async login(params:any){
        ///users/loginInfo
        const result=await axios.post(`mshop/api/gataway/login`,params);
        return result;
    }

    /**
     * 获取登录用户信息
     */
    static async getUserInfo(){
        const result=await axios.get(`mshop/api/gataway/users/loginInfo`);
        return result;
    }

    /**
     * 退出登录
     */
    static async unLogin(){
        const result=await axios.get(`mshop/api/gataway/users/unLogin`);
        return result;
    }

    /**
     * 生成订单
     */
    static async addUserOrder(params:any){
        const result=await axios.post(`mshop/api/gataway/users/addOrder`,params);
        return result;
    }

    /**
     * 我的订单列表
     */
    static async listUserOrder(params:any){
        const result=await axios.post(`mshop/api/gataway/users/listUserOrder`,params);
        return result;
    }

    /**
     * 删除用户订单
     * @param params
     */
    static async deleteUserOrder(params:any){
        const result=await axios.post(`mshop/api/gataway/users/deleteUserOrder`,params);
        return result;
    }
}